package cn.le.api;

import cn.le.bean.dto.MsgGroupDTO;
import cn.le.bean.dto.MsgPointDTO;
import cn.le.bean.util.ResponseFactory;
import cn.le.service.ImMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "im消息发送")
@RequestMapping(value = "/imMsg/")
public class ImMsgApi {

    @Autowired
    private ImMsgService imMsgService;

    @RequestMapping(value = "sendPoint",method= RequestMethod.POST)
    @ApiModelProperty(value = "im用户登录",notes = "im用戶登录")
    public Object sendPoint(@RequestBody MsgPointDTO dto){
          imMsgService.sendPoint(dto);
          return ResponseFactory.ok();
    }
    @RequestMapping(value = "sendGroup",method= RequestMethod.POST)
    @ApiModelProperty(value = "im用户登录",notes = "im用戶登录")
    public Object sendGroup(@RequestBody MsgGroupDTO dto){
        imMsgService.sendGroup(dto);
        return ResponseFactory.ok();
    }
}
